<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title></title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/bootstrap.css" />
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/css/bootstrap-responsive.css" />
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/style.css" />
<script type="text/javascript" src="${pageContext.request.contextPath}/js/bootstrap.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/ckform.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/common.js"></script>
<script src="${pageContext.request.contextPath}/js/jquery.min.js?v=2.1.4"></script>

<style type="text/css">
body {font-size: 20px;
	padding-bottom: 40px;
	background-color: #e9e7ef;
}

.sidebar-nav {
	padding: 9px 0;
}

@media ( max-width : 980px) {
	/* Enable use of floated navbar text */
	.navbar-text.pull-right {
		float: none;
		padding-left: 5px;
		padding-right: 5px;
	}
}
</style>
	<script>
		$(function () {
			loadData();

		})
		function loadData() {
			$.ajax({
				url:"${pageContext.request.contextPath}/btype/getSmallCategory",
				type:"post",
				data:{"typeid":${typeid}},
				dataType:"json",
				cache:false,
				success:function (rs) {
					$("#tbody").empty();
					$.each(rs,function (index,element) {
						var tr="<tr>\n" +
								"\t\t\t   <td>"+element.typename+"</td>\n" +
								"\t\t\t   <td>"+element.typedes+"</td>\n" +
								"\t\t\t   <td>\n" +
								"\t\t\t\t   <a href=\"javascript:deleteBtype("+element.typeid+")\">删除</a>\n" +
								"\t\t\t   </td>\n" +
								"\t\t   </tr>"
						$("#tbody").append(tr);
					})
				}
			})
		}
		function deleteBtype(typeid) {
			$.ajax({
				url:"${pageContext.request.contextPath}/btype/deleteBtype",
				type:"post",
				data:{"typeid":typeid},
				dataType:"json",
				cache:false,
				success:function (rs) {
					if (rs.status==200){
						alert(rs.msg);
						loadData();
					}else{
						alert(rs.msg);
					}
				}
			})
		}
	</script>
</head>
<body>
	<form class="form-inline definewidth m20" >
		 <font color="#777777"><strong>小类信息：</strong></font> 
		
	</form>
	<table class="table table-bordered table-hover definewidth m10">
		<thead>
			<tr>
				<th>小类名称</th>
			    <th>介绍</th>
				<th>删除</th>
			</tr>
		</thead>
		<tbody id="tbody">
		   <%--存放数据行： --%>

		</tbody>

	</table>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button type="button"  id="addnew">
			<a href="${pageContext.request.contextPath}/btype/subtype_add?typeid=${typeid}">添加小类</a>
	  </button>
</body>

</html>
